package com.design;

/**
 * html格式输出
 */
public class HtmlReportVisitor implements ReportVisitor {
    @Override
    public void visitUserReport(UserReport userReport) {
        System.out.println("<tr><td>" + userReport.getName() + "</td><td>" + userReport.getAge() + "</td><td>" + userReport.getAddress() + "</td></tr>");
    }

    @Override
    public void visitSaleReport(SaleReport saleReport) {
        System.out.println("<tr><td>" + saleReport.getProductName() + "</td><td>" + saleReport.getPrice() + "</td><td>" + saleReport.getQuantity() + "</td></tr>");
    }
}
